/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Abahe
 */
public class Question {

    int soal1;
    int soal2;
    String matter;
    String answer;

    public void setAnswer(String answer) {
        this.answer = answer;
    }

    public void setMatter(int matter1, String sTanda, int matter2) {
        this.soal1 = matter1; 
        this.soal2 = matter2;
        if (sTanda.equals("+")) {
            this.matter = matter1 + "+" + matter2;
            this.setAnswer(String.valueOf(soal1 + soal2));
        } else if (sTanda.equals("-")) {
            this.matter = matter1 + "-" + matter2;
            this.setAnswer(String.valueOf(soal1 - soal2));
        } else if (sTanda.equals("x")) {
            this.matter = matter1 + "x" + matter2;
            this.setAnswer(String.valueOf(soal1 * soal2));
        } else if (sTanda.equals("/")) {
            this.matter = matter1 + "/" + matter2;
            this.setAnswer(String.valueOf(soal1 / soal2));
        }
    }

    public Question() {
        matter = "";
        answer = "";
    }
}
